<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        <input type="text" placeholder="请输入想要查询的城市" v-model="country" @keyup.enter="query">
        <button @click="query">搜索</button>
        <ul>
            <li v-for="item in weather">{{item.high}}</li>
        </ul>
    </div>
    <script>
        var app = new Vue({
            el:"#app",
            data:{
                country:"",
                weather:[]
            },
            methods:{
                query:function(){
                    var thisA = this;
                    axios.get("http://wthrcdn.etouch.cn/weather_mini?city="+this.country)
                    .then(function(response){
                        console.log(response);
                        thisA.weather = response.data.data.forecast
                    },function(err){
                        console.log(err);
                    })
                }
            }
        })
    </script>
</body>
</html>